local skel = fk.CreateSkill{
  name = "tea__yuewen",
}
--local U = require "packages/utility/utility"
Fk:loadTranslationTable{
  ["tea__yuewen"] = "阅文",
  [":tea__yuewen"] = "一名角色的出牌阶段结束后，你可以弃置一张手牌，然后将牌堆顶至多三张牌置入弃牌堆。",
  ["#tea__yuewen-invoke"] = "阅文：你可以弃置一张手牌，然后将牌堆顶至多三张牌置入弃牌堆"
}
---@type TrigSkelSpec<PhaseFunc>
local yuewen = {
  anim_type = "special",
  can_trigger = function (self, event, target, player, data)
    return player:hasSkill(skel.name) and target.phase == Player.Play and not player:isKongcheng()
  end,
  on_cost = function (self, event, target, player, data)
    local suc, dat = player.room:askToUseActiveSkill(player, {
      skill_name = "tea__yuewen_active",
      prompt = "#tea__yuewen-invoke"
    })
    if suc and dat then
      event:setCostData(self, { num = dat.interaction, cards = dat.cards })
      return true
    end
  end,
  on_use = function (self, event, target, player, data)
    local num = event:getCostData(self).num ---@type integer
    local cards = event:getCostData(self).cards ---@type integer[]
    local room = player.room
    room:throwCard(cards, skel.name, player, player)
    local cids = room:getNCards(num)
    room:moveCardTo(cids, Card.DiscardPile, nil, fk.ReasonPutIntoDiscardPile, skel.name, nil, true)
  end
}
skel:addEffect(fk.EventPhaseEnd, yuewen)
-- Fk.generals["mouxusheng"]:addSkill(skel.name)
return skel